From: Carlos Garnacho Date: Thu, 15 Aug 2019 11:28:59 +0000 (+0200) Subject: ibusManager: Add call to restart the ibus daemon X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~819^2^2~14 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8be95b5785ee568558bed4fa29a41f3b47934457;p=gnome-shell.git ibusManager: Add call to restart the ibus daemon We may need to restart it with different arguments, so make it possible to do that. Also, avoid to just restart it on _clear(), this is now most likely through our --replace call than it is through ibus-daemon eg. dying, avoids some noise in logs as there is already an ongoing ibus-daemon. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/680 --- diff --git a/js/misc/ibusManager.js b/js/misc/ibusManager.js index 5a2d24e2f..6c8266271 100644 --- a/js/misc/ibusManager.js +++ b/js/misc/ibusManager.js @@ -59,15 +59,19 @@ var IBusManager = class { this._spawn(); } - _spawn() { + _spawn(extraArgs = []) { try { - Gio.Subprocess.new(['ibus-daemon', '--xim', '--panel', 'disable'], - Gio.SubprocessFlags.NONE); + let cmdLine = ['ibus-daemon', '--panel', 'disable', '--xim', ...extraArgs]; + Gio.Subprocess.new(cmdLine, Gio.SubprocessFlags.NONE); } catch (e) { log(`Failed to launch ibus-daemon: ${e.message}`); } } + restartDaemon(extraArgs = []) { + this._spawn(['-r', ...extraArgs]); + } + _clear() { if (this._panelService) this._panelService.destroy(); @@ -80,8 +84,6 @@ var IBusManager = class { this._currentEngineName = null; this.emit('ready', false); - - this._spawn(); } _onConnected() {